package com.yixun.qfbao.response.premises.detail;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

import com.yixun.qfbao.apidto.PremisesDetailResDto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author zilong.liu
 * @date 2020-8-12
 */
@Data
public class RewardInfo implements Serializable{

	private static final long serialVersionUID = 1L;
	
	public RewardInfo() {
	}

	public RewardInfo(PremisesDetailResDto detailResDto) {
		//奖金信息
		String reward = detailResDto.getReward();
		String dealReward = detailResDto.getDealAward();
		String rewardType = detailResDto.getDealType();
		if(!StringUtils.isBlank(reward) && !"null".equals(reward) && !"0".equals(reward)) {
			this.reward = reward;
		}
		if(!StringUtils.isBlank(dealReward) && !"null".equals(dealReward) && !"0".equals(dealReward)) {
			this.dealReward = detailResDto.getDealAward();
		}
		if(!StringUtils.isBlank(rewardType) && !"null".equals(rewardType)) {
			this.rewardType = detailResDto.getDealType();
		}
	}

	@ApiModelProperty(value = "带看奖")
	private String reward;
	
	@ApiModelProperty(value = "1 成交奖 2现金奖")
	private String rewardType;
	
	@ApiModelProperty(value = "成交奖或现金奖励")
	private String dealReward;
}
